<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" template="/paginas/template.xhtml">

	<ui:define name="corpoForm">
		


		<h:form id="formBotoesPessoa" prependId="false">
			<p:panelGrid columns="1" styleClass="botoes" id="botoes">
				<p:commandButton id="botaoCriarPessoa" value="#{rsc.label_criar}"  rendered="#{p:ifGranted('CRIAR_FORNECEDOR')}" 
					styleClass="botao" action="#{manterPessoaBean.criarEntidade}"
					ajax="false" title="#{rsc.title_criar}" />
			</p:panelGrid>
		</h:form>

		<p:confirmDialog message="#{msg.questionConfirmaHabilitar}"
			appendTo="@(body)" width="250" id="habilitarDialog"
			header="#{rsc.label_confirmar}" severity="alert"
			widgetVar="habilitar">
			<h:form id="habilitarForm">
				<p:commandButton value="#{rsc.label_sim}"
					actionListener="#{manterPessoaBean.habilitar}"
					oncomplete="habilitar.hide()" styleClass="botao"
					update=":formListPessoas:listaPessoas, :growl" />
				<p:commandButton value="#{rsc.label_nao}" onclick="habilitar.hide()"
					styleClass="botao"/>
			</h:form>
		</p:confirmDialog>

		<p:confirmDialog message="#{msg.questionConfirmaDesabilitar}"
			appendTo="@(body)" width="250" id="desabilitarDialog"
			header="#{rsc.label_confirmar}" severity="alert"
			widgetVar="desabilitar">
			<h:form id="desabilitarForm">
				<p:commandButton value="#{rsc.label_sim}" styleClass="botao"
					actionListener="#{manterPessoaBean.desabilitar}"
					oncomplete="desabilitar.hide()"
					update=":formListPessoas:listaPessoas, :growl" />
				<p:commandButton value="#{rsc.label_nao}"
					onclick="desabilitar.hide()" styleClass="botao" />
			</h:form>
		</p:confirmDialog>

		<f:event type="javax.faces.event.PreRenderComponentEvent"
			listener="#{manterPessoaBean.preRenderListFornecedor}" />
		<h:form id="formListPessoas" prependId="false">

			<ui:include src="/paginas/crm/pessoa/listar.xhtml" />

		</h:form>

	</ui:define>
</ui:composition>

